//
//  LDApiManger.swift
//  DingDongZP
//
//  Created by 三秒文化 on 16/6/9.
//  Copyright © 2016年 iyhjiang.com. All rights reserved.
//

import UIKit

public let baseAppFormalUrl = "https://www.dingdong.cc/appws"//
public let baseAppTestUrl = "https://test.dingdong.cc/appws" //测试地址

private let appUrl = DDAPIGenerate.sharedInstance().serverType == kLinkServerType
    .LinkServerTypeOfNormal ? baseAppFormalUrl:baseAppTestUrl

/**网络地址*/
struct LDJobfinderAPI {
    
    struct view {
        
        struct myself {
            
            static let resume = "\(appUrl)/jobfinder_view_myself_resume.php"
        }
    }
    
//    func getRerumeVoiceApi(name:String) ->String {
//        return "https://114.55.59.142/audio/" + name
//    }
    
    struct set {
        
        /**设置工作状态*/
        static let status = "\(appUrl)/jobfinder_set_status.php"
        /**设置亮点标签*/
        static let highlight = "\(appUrl)/jobfinder_set_highlight_tags.php"
        /**切换语音文本*/
        static let changeVocieResume = "\(appUrl)/jobfinder_set_resume_audio_or_text.php"
        /**设置优势文本*/
        static let setMyStrengths = "\(appUrl)/jobfinder_set_mystrengths_text.php"
        //
        static let changePassword = "\(appUrl)/changepassword.php"
        /**牛人端设置当前期望工作*/
        static let setCurrentExpJob = "\(appUrl)/jobfinder_set_current_expectedjob.php"
        static let upLoadGeTuClient = "\(appUrl)/jobfinder_set_getui_clientid.php"
        //牛人端设置提醒设置
        static let getuiPush = "\(appUrl)/jobfinder_set_pushnotification.php"
        
        /**提交订单金额*/
        static let submitInvoiceMoneyInfo = "\(appUrl)/money.php?act=invoiceApply"
        /**提交修改发票信息*/
        static let submitInvoiceEditInfo = "\(appUrl)/money.php?act=putInvoice"
        
        /**设置默认发票信息*/
        static let selectedInvoiceInfo = "\(appUrl)/money.php?act=setInvoiceDefault"
    }
    
    struct query {
        
        static let profile = "\(appUrl)/jobfinder_query_profile.php"
        static let status = "\(appUrl)/query_jobfinder_status.php"
        //牛人端查询系统消息
        static let systemMessage = "\(appUrl)/jobfinder_query_system_msg.php"
        static let rongyunToken = "\(appUrl)/jobfinder_query_rongcloud_token.php"
        //
        static let seeJobs = "\(appUrl)/jobs.php?page="
        //牛人端查询提醒设置
        static let getuiPush = "\(appUrl)/jobfinder_query_pushnotification_settings.php"
        
        /// 得到抬头信息
        static let invoiceInfo = "\(appUrl)/money.php?act=getInvoice"
        
        /**得到账单列表*/
        static let getInvoiceBillList = "\(appUrl)/money.php?act=getInvoiceList"
        /**得到账单历史记录*/
        static let getInvoiceBillHistoryList = "\(appUrl)/money.php?act=invoiceApplyList"
        
        /**得到账单详细记录*/
        static let getInvoiceBillHistoryListDetail = "\(appUrl)/money.php?act=invoiceApplyDetail"
        /**删除账单历史记录*/
        static let deleteInvoiceBillHistory = "\(appUrl)/money.php?act=delInvoiceApply"
        
        /**删除抬头信息*/
        static let deleteInvoiceBillList = "\(appUrl)/money.php?act=delInvoice"
        
        /**得到面试列表*/
        static let getInterviewList = "\(appUrl)/interview.php?act=getInterviewList"
        /**得到面试详情*/
        static let getInterviewListDetail = "\(appUrl)/interview.php?act=getInterview"
        /**保存面试详情*/
        static let editAndSaveInterviewListDetail = "\(appUrl)/interview.php?act=saveInterview"
        
    }
    
    struct delete {
        /** 牛人端删除期望工作 */
        static let expectedjob = "\(appUrl)/jobfinder_delete_expectedjob.php"
        /** 牛人端删除工作经历 */
        static let workexperience = "\(appUrl)/jobfinder_delete_workexperience.php"
        /** 牛人端删除教育经历 */
        static let eduexperience = "\(appUrl)/jobfinder_delete_eduexperience.php"
        /** 牛人端删除语音微简历 */
        static let myresumevocie = "\(appUrl)/jobfinder_delete_audio_resume.php"
    }
    
    struct create {
        /**增加期望工作*/
        static let expectedjob = "\(appUrl)/jobfinder_create_expectedjob.php"
        /**牛人端添加工作经历*/
        static let workexperience = "\(appUrl)/jobfinder_create_workexperience.php"
        /**牛人端添加教育经历*/
        static let eduexperience = "\(appUrl)/jobfinder_create_eduexperience.php"
    }
    
    struct edit {
        /**增加期望工作*/
        static let expectedjob = "\(appUrl)/jobfinder_edit_expectedjob.php"
        /**牛人端编辑工作经历*/
        static let workexperience = "\(appUrl)/jobfinder_edit_workexperience.php"
        /**牛人端编辑教育经历*/
        static let eduexperience = "\(appUrl)/jobfinder_edit_eduexperience.php"
    }
    
    struct upload {
        struct audio {
            
            /**上传亮点*/
            static let highlights = "\(appUrl)/jobfinder_upload_audio_highlights.php"
            /**我的优势*/
            static let mystrengths = "\(appUrl)/jobfinder_upload_audio_mystrengths.php"
            /**工作经历*/
            static let workexperience = "\(appUrl)/jobfinder_upload_audio_workexperience.php"
            /**教育经历*/
            static let eduexperience = "\(appUrl)/jobfinder_upload_audio_eduexperience.php"
        }
    }
    
    struct download {
        struct audio {
            static let baseAudioUrl = "\(appUrl)/audio/"
            /**下载亮点*/
            static let highlights = "\(appUrl)/audio/1_highlights.mp3"
            /**下载优势*/
            static let mystrengths = "\(appUrl)/audio/1_mystrengths.mp3"
            /**下载经历*/
            static let workexperience = "\(appUrl)/audio/1_workexperience.mp3"
            /**下载经历*/
            static let eduexperience = "\(appUrl)/audio/1_eduexperience.mp3"
        }
    }
    
    struct discover {
        
        /**牛人端搜索职位 类别 ID 筛选*/
        static let filter = "\(appUrl)/jobfinder_discover_jobs_filter.php"
        /**牛人端搜索职位 文本 ＋ 类别 ID*/
        static let search = "\(appUrl)/jobfinder_discover_jobs_search.php"
    }
}
struct LDCommentAPI {
    
    static func getPicApi(name:String?) ->String{
        
        if name == nil {
            return LDNull
        }
        
        var api = ""
        
        if name!.hasPrefix("logo") {
            
            api = appUrl + "/" + name!
        } else if name!.hasPrefix("assets") {
            
            api = appUrl + "/" + name!
            
        } else {
            
            api = appUrl + "/logo/" + name!
        }
        
        return api
    }
    static func getAudioApi(name:String?) ->String {
        
        if name == nil {
            return ""
        }
        
        return "\(appUrl)/audio/" + name!
    }
    
    static func getAbsoluteUrl(suffix:String) ->String {
        
        let api = appUrl + "/" + suffix
        return api
    }
    
    //查询所有对牛人的举报
    static let reportJobfinder = "\(appUrl)/query_complaints_about_jobfinder.php"
    
    static let queryEmploryHeightLightTags = "\(appUrl)/query_employer_teamhighlight_tags.php"
    //
    static let appConfigure = "\(appUrl)/query_app_system_settings.php"
    
    static let registerUserInfo = "\(appUrl)/register.php"
    static let resetPassword = "\(appUrl)/resetpassword.php"
    static let getSecurityCode = "\(appUrl)/getverifycode.php?mobile="
    static let expressLogin = "\(appUrl)/login_express.php"
    
    static let queryDDPlus = "\(appUrl)/query_ddplus.php"
  
    /** 职位种类 */
    static let jobCategories = "\(appUrl)/query_job_categories.php"
    /** 行业信息 */
    static let industries = "\(appUrl)/query_industries.php"
    /** 省份信息 */
    static let provinces = "\(appUrl)/query_provinces.php"
    /** city信息 */
    static let city = "\(appUrl)/query_cities.php"
    /** year信息 */
    static let experience = "\(appUrl)/query_experience.php"
    static let jobExperience = "\(appUrl)/query_experience_for_filter.php"
    
    static let jobExperienceEdit = "\(appUrl)/query_experience_for_edit.php"
    /** 查询所有薪资 */
    static let salary = "\(appUrl)/query_salary.php"
    static let salaryJobfinder = "\(appUrl)/query_salary_for_filter.php"
    
    /** 查询所有亮点 */
    static let heightLight = "\(appUrl)/query_jobfinder_highlight_tags.php"
    /** 根据二级职位类别查询所有工作重点标签 */
    static let level2jobcategory = "\(appUrl)/query_jobstrenghs_requirments_tags_for_level2jobcategory.php?level2_id="
    /** 学历信息 */
    static let edu = "\(appUrl)/query_edu.php"
    static let eduJobfinder = "\(appUrl)/query_edu_for_filter.php"
    static let eduJobfinderEdit = "\(appUrl)/query_edu_for_edit.php"
    /** 公司信息 */
    static let companySize = "\(appUrl)/query_companysize.php"
    static let companySizeJobfinder = "\(appUrl)/query_companysize_for_filter.php"
    /** 牛人端常见问题 */
    static let commentJobFinderQuest = "\(appUrl)/query_faqs_for_jobfinder.php"
    /** Boss 端常见问题 */
    static let commentBossQuest = "\(appUrl)/query_faqs_for_employer.php"
    
    
    /** 省市区 */
    static let thridPlace = "\(appUrl)/place.json"
    
    //
    static let appConfigureXML = "\(appUrl)/LDAPPConfig.xml"
    
}
struct LDEmploryAPI {
    
    struct set {
        
        static let getuiPush = "\(appUrl)/employer_set_pushnotification.php"
        static let reportJobfinder = "\(appUrl)/employer_complain_about_jobfinder.php"
    }
    struct view {
        /** Boss 端查看自己发布的所有职位 */
        static let allPublishJobs = "\(appUrl)/employer_view_myself_all_jobs.php"
        
    }
    struct discover {
        /** 查询所有牛人 */
        static let jobfinders_search = "\(appUrl)/employer_discover_jobfinders_search.php"
    }
    struct query {
        
        /** 查询某个牛人微简历 */
        static let jobfinders_resume = "\(appUrl)/employer_loggedin_view_resume.php"
        /**  Boss 端查询广告轮播图 */
        static let query_ads = "\(appUrl)/query_ads_employers.php"
        /**  Boss 端查询个人信息 */
        static let query_profile = "\(appUrl)/employer_query_profile.php"
        
        static let alljobs = "\(appUrl)/employer_view_myself_all_jobs.php"
        
        static let rongyunToken = "\(appUrl)/employer_query_rongcloud_token.php"
        
        static let getuiPush = "\(appUrl)/employer_query_pushnotification_settings.php"
        static let companyInfo =  "\(appUrl)/employer_query_companyinfo.php"
    }
}